#include<iostream>
#include<cstdio>
using namespace std;
int a[200001]={2},bz[200001];
int main()
{
    freopen("fruit.in","r",stdin);
    freopen("fruit.out","w",stdout);
    int n,s;
    cin>>n;
    s=n;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    while(s>0)
    {
        for(int i=1;i<=n;i++)
            if(a[i]!=a[i-1]&&bz[i]==0)
            {
                bz[i]=1;
                cout<<i<<" ";
                s--;
            }
        cout<<endl;
    }
}